	<ul>
	   <? 
			foreach ($documents as $document) { 
				if (!( $document->getName())) { continue; } 
	    ?>
	   			 <li class="text">
		 			<h4>
					<?
						$desc = $document->getDescription();
						$date = $document->getAnnotateDate();
						$code = $document->getCode();
						$show_edit = true;
			    
						$name = $document->getName();
						$disp_name = ($desc == "" ? $name : $desc);
						$download_qs = "d=$date&c=$code&f=$name";
						
						if($groupid && 
							!EntitlementPeer::isEntitled($groupid, $user->getId(),EntitlementPeer::GROUP_TYPE,
								EntitlementPeer::WRITE_PERMISSION)) {
									$show_edit = false;
						}  
						if($show_edit) {
							$view_link = link_to($disp_name, 'files/show?d='.$date.'&c='.$code, 'target="_blank"');
							echo $view_link; 	
						} else {
							echo $disp_name;
						}
					?>
		 			</h4>
					<p class="details">
		    				tags: <? echo esc_specialchars($document->getTags()); ?> 
					</p>
					<p>
		   				<?
							if($show_edit)  {
								$view_link2 = link_to('View', 'files/show?d='.$date.'&c='.$code, 'target="_blank"');
								echo $view_link2 .  "&nbsp;|&nbsp;"; 
							}						 
						?>
		    				<? echo link_to('Download','files/download',array('query_string' => $download_qs)); ?>
							&nbsp;&nbsp;&nbsp;&nbsp;
		    				<? if($document->getOwnerId() == $user->getId()) : ?>
							<a class="delete-doc-lnk" fc_c = "<? echo $code; ?> " fc_d = "<? echo $date; ?>" fc_doc = "<? echo $disp_name; ?>"
						href="javascript:void(0)">Delete</a>
						<? endif; ?>
					</p>
	    			</li>
	   	 <? } ?>
	</ul>
